//
//  LYEArtisitCellHeaderView.m
//  artist
//
//  Created by Jay_Apple on 16/3/3.
//  Copyright © 2016年 viviyoo. All rights reserved.
//

#import "LYEArtisitCellHeaderView.h"
#import "LYEArtistCellHeaderModel.h"

@interface LYEArtisitCellHeaderView ()

@property (weak, nonatomic) IBOutlet UIView *indicator;

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;

@end

@implementation LYEArtisitCellHeaderView

- (void)awakeFromNib{

    UITapGestureRecognizer *titleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(titleTap)];
    
    [self.titleLabel addGestureRecognizer:titleTap];
    
    UITapGestureRecognizer *contentTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(contentTap)];
    [self.contentLabel addGestureRecognizer:contentTap];

}

- (void)titleTap{
    
    if ([self.delegate respondsToSelector:@selector(headerTitleOnclcik:)]) {
        [self.delegate headerTitleOnclcik:self];
    }
    
}

- (void)contentTap{

    if ([self.delegate respondsToSelector:@selector(headerContentOnclick:)]) {
        [self.delegate headerContentOnclick:self];
    }

}

#pragma mark - 重写方法

- (void)setModel:(LYEArtistCellHeaderModel *)model{

    _model = model;
    
    self.indicator.backgroundColor = [UIColor colorWithHexString:_model.IndicatorColor alpha:1];
    self.titleLabel.text = _model.title;
    self.contentLabel.text = _model.content;

}

@end
